/*
 * @Author: liuxiao
 * @Date: 2023-11-01 19:00:01
 * @Last Modified by: liuxiao
 * @Last Modified time: 2024-02-03 14:12:41
 * @ps:对外暴露配置路由,常量路由
 */

//私有路由表
/**
 * 私有路由表
 */
export const privateRoutes = [
  {
    path: '/private',
    component: () => import('@/layout/index.vue'),
    name: 'Acl',
    meta: {
      title: '权限管理',
      hidden: false,
      icon: 'acl'
    },
    redirect: '/acl/user',
    children: [
      {
        //把需要更换的组件都放这里
        //在父组件中对应位置放一个router-view
        //在子组件中直接使用push更换页面
        path: '/acl/user',
        component: () => import('@/views/acl/user/index.vue'),
        name: 'Acl',
        meta: {
          title: '用户管理',
          hidden: false,
          icon: 'user'
        }
      },
      {
        path: '/acl/role',
        component: () => import('@/views/acl/role/index.vue'),
        name: 'Role',
        meta: {
          title: '角色管理',
          hidden: false,
          icon: 'juese'
        }
      },
      {
        path: '/acl/permission',
        component: () => import('@/views/acl/permission/index.vue'),
        name: 'permission',
        meta: {
          title: '菜单管理',
          hidden: false,
          icon: 'caidan'
        }
      }
    ]
  }
]

export const constantRoute = [
  {
    //登录
    path: '/loginTest',
    component: () => import('@/views/test/login.vue'),
    name: 'loginTest', //命名路由
    meta: {
      title: '登录测试', //菜单标题
      hidden: true //代表路由的标题在菜单中是否隐藏，true代表隐藏
    }
  },
  {
    //登录
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    name: 'login', //命名路由
    meta: {
      title: '登录', //菜单标题
      hidden: true //代表路由的标题在菜单中是否隐藏，true代表隐藏
    }
  },
  {
    //登录成功后展示数据的路由
    path: '/',
    component: () => import('@/layout/index.vue'),
    name: 'layout',
    meta: {
      title: '',
      hidden: false,
      icon: '' //菜单文字左侧的图标，支持elemnet-plus全部的图标
    },
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: () => import('@/views/home/index.vue'),
        meta: {
          title: '后台首页',
          hidden: false,
          icon: 'index'
        }
      }
    ]
  },
  {
    //登录
    path: '/screen',
    component: () => import('@/views/screen/index.vue'),
    name: 'Screen', //命名路由
    meta: {
      title: '数据大屏', //菜单标题
      hidden: false, //代表路由的标题在菜单中是否隐藏，true代表隐藏
      icon: 'mau'
    }
  },
  // {
  //   path: '/course',
  //   component: () => import('@/layout/index.vue'),
  //   redirect: '/course/list',
  //   meta: {
  //     title: '课程管理',
  //     hidden: false,
  //     icon: 'course1'
  //   },
  //   children: [
  //     {
  //       //把需要更换的组件都放这里
  //       //在父组件中对应位置放一个router-view
  //       //在子组件中直接使用push更换页面
  //       path: '/course/list',
  //       component: () => import('@/views/course/list.vue'),
  //       name: 'courseList',
  //       meta: {
  //         title: '课程列表',
  //         hidden: false,
  //         icon: 'course3'
  //       }
  //     },
  //     {
  //       path: '/add',
  //       component: () => import('@/views/course/add.vue'),
  //       name: 'courseCategory',
  //       meta: {
  //         title: '发布课程',
  //         hidden: false,
  //         icon: 'course4'
  //       }
  //     }
  //   ]
  // },
  {
    path: '/courses',
    name: 'courses',
    component: () => import('@/layout/index.vue'),
    redirect: '/courses/CoursesIndex',
    meta: {
      title: '课程管理',
      hidden: false,
      icon: 'course1'
    },
    children: [
      {
        //把需要更换的组件都放这里
        //在父组件中对应位置放一个router-view
        //在子组件中直接使用push更换页面
        path: '/courses/CoursesIndex',
        component: () => import('@/views/courses/CoursesIndex.vue'),
        name: 'CoursesIndex',
        meta: {
          title: '课程列表',
          hidden: false,
          icon: 'course3'
        }
      },
      {
        path: '/courses/create',
        component: () => import('@/views/courses/CreateOrEdit.vue'),
        name: 'courseCreate',
        meta: {
          title: '新建课程',
          hidden: false,
          icon: 'course3'
        }
      },
      {
        path: '/courses/edit',
        component: () => import('@/views/courses/CreateOrEdit.vue'),
        name: 'courseEdit',
        meta: {
          title: '编辑课程',
          hidden: true,
          icon: 'course3'
        }
      },
      {
        path: '/courses/:courseId/content',
        component: () => import('@/views/courses/CourseContent.vue'),
        props: true,
        name: 'courseContent',
        meta: {
          title: '课程安排',
          hidden: true
        }
      },
      {
        path: '/courses/upload',
        component: () => import('@/views/courses/components/UploadVod.vue'),
        name: 'courseUpload',
        meta: {
          title: '视频上传',
          hidden: false,
          icon: 'course3'
        }
      }
    ]
  },
  {
    path: '/acl',
    component: () => import('@/layout/index.vue'),
    name: 'Acl',
    meta: {
      title: '权限管理',
      hidden: false,
      icon: 'acl'
    },
    redirect: '/acl/user',
    children: [
      {
        //把需要更换的组件都放这里
        //在父组件中对应位置放一个router-view
        //在子组件中直接使用push更换页面
        path: '/acl/user',
        component: () => import('@/views/acl/user/index.vue'),
        name: 'Acl',
        meta: {
          title: '用户管理',
          hidden: false,
          icon: 'user'
        }
      },
      {
        path: '/acl/role',
        component: () => import('@/views/acl/role/index.vue'),
        name: 'Role',
        meta: {
          title: '角色管理',
          hidden: false,
          icon: 'juese'
        }
      },
      {
        path: '/acl/permission',
        component: () => import('@/views/acl/permission/index.vue'),
        name: 'permission',
        meta: {
          title: '菜单管理',
          hidden: false,
          icon: 'caidan'
        }
      }
    ]
  },
  {
    path: '/teacher',
    component: () => import('@/layout/index.vue'),
    name: 'teacher',
    meta: {
      title: '讲师管理',
      hidden: false,
      icon: 'teacher1'
    },
    redirect: '/teacher/list',
    children: [
      {
        //把需要更换的组件都放这里
        //在父组件中对应位置放一个router-view
        //在子组件中直接使用push更换页面
        path: '/teacher/list',
        component: () => import('@/views/teacher/index.vue'),
        name: 'List',
        meta: {
          title: '讲师列表',
          hidden: false,
          icon: 'user'
        }
      },
      {
        path: '/teacher/add',
        component: () => import('@/views/teacher/add.vue'),
        name: 'Add',
        meta: {
          title: '添加讲师',
          hidden: false,
          icon: 'juese'
        }
      }
    ]
  },
  {
    path: '/category',
    component: () => import('@/layout/index.vue'),
    name: 'category',
    meta: {
      title: '分类管理',
      hidden: false,
      icon: 'teacher1'
    },
    redirect: '/category/list',
    children: [
      {
        //把需要更换的组件都放这里
        //在父组件中对应位置放一个router-view
        //在子组件中直接使用push更换页面
        path: '/category/list',
        component: () => import('@/views/category/list.vue'),
        name: 'List',
        meta: {
          title: '分类列表',
          hidden: false,
          icon: 'user'
        }
      },
      {
        //把需要更换的组件都放这里
        //在父组件中对应位置放一个router-view
        //在子组件中直接使用push更换页面
        path: '/category/table',
        component: () => import('@/views/category/table.vue'),
        name: 'table',
        meta: {
          title: '分类表格',
          hidden: false,
          icon: 'user'
        }
      },
      {
        path: '/category/add',
        component: () => import('@/views/category/add.vue'),
        name: 'Add',
        meta: {
          title: '添加分类',
          hidden: false,
          icon: 'juese'
        }
      }
    ]
  },
  {
    path: '/product/trademark',
    component: () => import('@/layout/index.vue'),
    meta: {
      title: '商品管理',
      hidden: false,
      icon: 'acl'
    }
  },
  {
    //404
    path: '/404',
    component: () => import('@/views/404/index.vue'),
    name: '404',
    meta: {
      title: '404',
      hidden: true
    }
  },
  {
    //404页面
    path: '/:pathMatch(.*)*',
    redirect: '/404',
    name: 'any',
    meta: {
      title: '任意路由',
      hidden: true
    }
  },
  {
    //测试模块路由
    path: '/test',
    component: () => import('@/layout/index.vue'),
    name: 'test',
    meta: {
      title: '测试模块',
      hidden: false,
      icon: 'test'
    },
    children: [
      {
        path: '/test/svg',
        component: () => import('@/views/test/svg.vue'),
        name: 'svg',
        meta: {
          title: 'SVG图标测试',
          hidden: false,
          icon: 'user'
        }
      },
      {
        path: '/test/upload',
        component: () => import('@/views/test/upload.vue'),
        name: 'svg',
        meta: {
          title: '图片上传',
          hidden: false,
          icon: 'user'
        }
      },
      {
        path: '/test/digui',
        component: () => import('@/views/test/digui.vue'),
        name: 'router',
        meta: {
          title: '递归组件',
          hidden: false,
          icon: 'user'
        }
      },
      {
        path: '/test/route',
        component: () => import('@/views/test/vuerouteAndvueRouter.vue'),
        name: 'route',
        meta: {
          title: 'vue-router和vue-route区别',
          hidden: false,
          icon: 'user'
        }
      },
      {
        path: '/test/menu',
        component: () => import('@/views/test/menu.vue'),
        name: 'menu',
        meta: {
          title: 'menu菜单',
          hidden: false,
          icon: 'user'
        }
      },
      {
        path: '/test/router',
        component: () => import('@/views/test/router.vue'),
        name: 'route',
        meta: {
          title: '结构化路由',
          hidden: false,
          icon: 'user'
        }
      },
      {
        path: '/test/input',
        component: () => import('@/views/test/input/index.vue'),
        name: 'input',
        meta: {
          title: 'input',
          hidden: false,
          icon: 'user'
        }
      }
    ]
  }
]
